//
//  UIPageDefines.h
//  芥子帝国
//
//  Created by 纳里健康 on 2018/3/8.
//  Copyright © 2018年 songK. All rights reserved.
//   定义页面所需要的常量

#ifndef UIPageDefines_h
#define UIPageDefines_h

//宽高
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_WIDTH  [UIScreen mainScreen].bounds.size.width
#define VIEW_HEIGHT CGRectGetHeight(self.view.frame)

#define SYSTEM_NUMBER [[[UIDevice currentDevice] systemVersion] floatValue]


//导航栏高度
#define NAVIGATOR_HEIGHT (IS_IPHONE_X ? 88.0f : 64.0f)

//iPhone 虚拟home键的高度
#define HOMEBAR_HEIGHT (IS_IPHONE_X ? 34.0f : 0.0f)

//UITabbarViewController
#define TABBAR_HEIGHT (IS_IPHONE_X ? 83.0f : 49.0f)

//状态栏高度
#define STATUSBAR_HEIGHT (IS_IPHONE_X ? 44.0f : 20.0f)

#define IS_IPHONE_4 (( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )480) < DBL_EPSILON ))
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
#define IS_IPHONE_6 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )667 ) < DBL_EPSILON )
#define IS_IPHONE_6_PLUS ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )736 ) < DBL_EPSILON )

#define IS_IPHONE_X ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )812 ) < DBL_EPSILON )
#define UUID [[UIDevice currentDevice].identifierForVendor UUIDString]

#define IOS6                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) // 判断是否是IOS6的系统
#define IOS7                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) // 判断是否是IOS7的系统
#define IOS8                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) // 判断是否是IOS8的系统
#define IOS9                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) // 判断是否是IOS9的系统
#define IOS10                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) // 判断是否是IOS10的系统
#define IOS11                        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0) // 判断是否是IOS11的系统
#if DEBUG // Set to 1 to enable debug logging
#define NSLog(x, ...) NSLog(x, ## __VA_ARGS__);
#else
#define NSLog(x, ...)
#endif

#define ApplicationVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define AppName  [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]
#define APP_DELEGATE_INSTANCE                       ((AppDelegate*)([UIApplication sharedApplication].delegate))
#define USER_DEFAULT                                          [NSUserDefaults standardUserDefaults]
#define NS_NOTIFICATION_CENTER                   [NSNotificationCenter defaultCenter]
#define kNetworkReachabilityStatus [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus


#define LGImageFor(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]

#define LGNibFor(nibName) [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil ].lastObject;

#define WeakObj(o) @autoreleasepool { }__weak typeof(o) o##Weak = o;
#define StrongObj(o) @autoreleasepool {} __strong typeof(o) o = o##Weak;

#define WEAKSELF                    typeof(self) __weak weakSelf = self;
#define STRONGSELF                  typeof(weakSelf) __strong strongSelf = weakSelf;
#endif /* UIPageDefines_h */
